<?php
namespace Home\Controller;
use Think\Controller;
Class GlobalController extends Controller
{
    //全球购
	public function index()
	{ 
        $condition['user_type'] = 1;

        $condition['user_state'] = 1;
 
        $country   = D("Index")->get_user_info($condition,2);

        $condition['user_type'] = 2;

        $omnimedia = D("Index")->get_user_info($condition,2);

		$validate['code'] = 0;

		$validate['msg']  = "成功";    
		
        if (empty($country)) {

			$validate['code'] = 1;

			$validate['msg']  = "县会长数据为空";      
			
			echo json_encode($validate);die;        
		}
		if (empty($omnimedia)) {

			$validate['code'] = 2;

			$validate['msg']  = "一带一路数据为空"; 
		}
		$validate['data_country']  = $country; 
		
		$validate['data_omnimedia']  = $omnimedia;      
		
      	echo json_encode($validate);die;        
    }

    //token过期自动跳转至登陆页面
    public function redirect_login()
    {
        $this->display("Index/login");
    }
}
?>


